package com.ikangtai.shecare.stickycalendar;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

import com.ikangtai.shecare.R;
import com.ikangtai.shecare.common.BaseActivity;
import com.ikangtai.shecare.common.baseView.TopBar;
import com.ikangtai.shecare.common.util.AppLog;
import com.ikangtai.shecare.stickycalendar.http.HCGValueHttp;
import com.ikangtai.shecare.stickycalendar.http.MemoHttp;
import com.ikangtai.shecare.stickycalendar.http.util.HCGValueMsg;
import com.ikangtai.shecare.stickycalendar.http.util.MemoMsg;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lijinyuan on 16/9/1.
 */
public class NoteCalendarActivity extends BaseActivity {

    private EditText memo;
    private TopBar topBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_notecalendar);

        memo= (EditText) findViewById(R.id.content_edit);

        initView();
    }

    private void initView() {
        topBar = (TopBar) findViewById(R.id.topBar);
        topBar.setOnTopBarClickListener(new TopBar.OnTopBarClickListener() {
            @Override
            public void leftClick() {
                finish();
            }

            @Override
            public void midLeftClick() {

            }

            @Override
            public void midRightClick() {

            }

            @Override
            public void rightClick() {
                AppLog.i("wzz-----memo---"+memo.getText());
                List<MemoMsg> memoMsgList = new ArrayList<MemoMsg>();
                MemoMsg memoMsg = new MemoMsg();
                memoMsg.setDateRecord("2016-08-29");
                memoMsg.setMemo(memo.getText().toString());
                memoMsgList.add(memoMsg);
                MemoHttp memoHttp = new MemoHttp(NoteCalendarActivity.this,memoMsgList);
                memoHttp.saveSelectedDayRecord();
            }
        });
    }
}
